using UnityEngine;
using M13.GameSystem;
using M13.Game.Entity.FSM;

namespace M13.Game.Entity.Player
{

    public class PlayerStateBase : StateBase
    {
        protected Animator animator;
        protected IInputCtrlSystem inputCtrlSystem;
        protected ICameraModal cameraModal;
        protected IPlayerModal playerModal;
        protected PlayerEntity player;
        protected PlayerStateMachine stateMachine;
        protected PlayerInventory playerInventory;

        protected float[] events;
        public void Init(PlayerStateMachine stateMachine, Animator animator, IInputCtrlSystem inputCtrlSystem, 
            ICameraModal cameraModal, IPlayerModal playerModal, PlayerEntity player, PlayerInventory playerInventory)
        {
            this.cameraModal = cameraModal;
            this.stateMachine = stateMachine;
            this.animator = animator;
            this.inputCtrlSystem = inputCtrlSystem;
            this.player = player;
            this.playerInventory = playerInventory;
            this.playerModal = playerModal;
        }

         
        public override float GetAnimPlayProgress()
        {
            return animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
        }

        public override bool IsCurrentAnimPlaying(string animName)
        {
            return animator.GetCurrentAnimatorStateInfo(0).IsName(animName);
        }
    }
}